/**
 * 登出url
 * @param {*} r 正式 测试前缀
 */
function signOutUrl(r) {
  // 返回地址使用origin
  let returnUrl = encodeURIComponent(window.location.origin)
  return `https://${r}sso.caigou2003.com/#/signOut?returnUrl=${returnUrl}`
}
function modifyPwd(r){
  let returnUrl = encodeURIComponent(window.location.href)
  return `https://${r}sso.caigou2003.com/#/modifyPwd?returnUrl=${returnUrl}`
}
$(function () {
  let _ = "" // 正式
  if (window.location.host.indexOf("test") !== -1) _ = "test" // 测试
  // 退出登录
  let el = document.querySelector("span.logout")
  el.addEventListener("click", () => {
    window.location.href = signOutUrl(_)
  })
  // 修改密码按钮
  let modify = document.querySelector("div.value a")
  modify.href = modifyPwd(_)
})
